Add real-world examples section to the playground#281
Conversation
Agent-Logs-Url: https://github.com/githubnext/tsessebe/sessions/866f6160-4548-40a9-bf34-f13d43109ad6 Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
…-in-browser-examples
|
Commit pushed:
|
Evergreen: Merge with
|
…-in-browser-examples
|
Commit pushed:
|
Evergreen: Branch updated ✅This PR was 42 commits behind The branch is now up to date. CI should run on the new HEAD
|
…-in-browser-examples
…cks self-contained - Add "examples.html" to NON_PLAYGROUND_PAGES in tests/playground.test.ts and tests-e2e/playground-cells.test.ts (it's an index/gallery page, not an interactive playground) - Prepend data-setup code to each playground-python textarea block so every block runs independently without depending on variables from the JS editor or other blocks (fixes 18 Python validation failures) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Commit pushed:
|
1 similar comment
|
Commit pushed:
|
Evergreen — CI fixI pushed two commits to bring this PR up to date: 1. Merge 2. Fix failing CI checks — addressed all 3 failing jobs:
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "releaseassets.githubusercontent.com"See Network Configuration for more information.
|
…-in-browser-examples
|
Commit pushed:
|
|
Evergreen 🌲 — merged The merge was clean (no conflicts). CI checks should now run on the updated branch.
|
The playground had a page per individual feature but nothing showing tsb used end-to-end on realistic data. This adds an Examples section: 10 self-contained, in-browser tutorials covering common pandas workflows.
Hub
playground/examples.html— grid of 10 example cards.playground/index.html— new "Real-World Examples" section above the feature roadmap, linking to the hub.Examples (
playground/example_*.html)Each page has 1–3 editable code blocks with inline realistic data, a Python equivalent tab, and ASCII bar-chart output rendered through
console.log.readCsv,groupby().agg,nlargestDataFramepctChangeSeries,Series.rolling().mean/std, SMA crossoverdtaccessor,groupbygroupby().size,cumsum,pctChangeSeriescrosstabwithnormalize: "index"Series.map,groupby,pivot,fillnagroupby().agg, lift,describepivotTable(source × device)concat,groupby,rankSeries,sortValuescutwith labels,valueCountsAll pages reuse the existing
playground-runtime.js(TS-compiler + tsb bundle + transparent-textarea highlighting) — no runtime changes.Charts
Examples render visual output by emitting unicode block bars through
console.log, which the runtime captures and shows in the output panel:Verification
A Playwright harness loads all 11 new pages, clicks every Run button, and asserts every block runs without error and produces output (22/22 blocks pass). The examples use only existing public tsb APIs; no
src/changes.